<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>国省自检--${fns:getConfig('productName')}</title>
<link rel="stylesheet" href="${ctx}/styles/gsjcss/common.css">
<script type="text/javascript">
    function btnClick(){
    	 var url = '${ctx}/jsRoadMatRecUtilize/search.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}';
         var data = {};
		 data['retrieval'] = getJson('condition');
		 loadData(url,data);
      }
    //ajax执行成功之后的回调方法
    function loadDataToTable(data){
    	var attData = data['att'];
    	var total = data['score'];
    	var percent = data['percent'];
    	var testYear = data['testYear'];
    	var asphalMaterial = data['asphalMaterial'];
    	var asphalLocalUse = data['asphalLocalUse'];
    	var asphalCycleUse = data['asphalCycleUse'];
    	var cementMaterial = data['cementMaterial'];
    	var cementLocalUse = data['cementLocalUse'];
    	var cementCycleUse = data['cementCycleUse'];
    	var wholeRate = data['wholeRate'];
    	var firstScore = data['firstScore'];
    	var roadCyclesSecond = data['roadCyclesSecond'];
        var secondScore = data['resultLists'];
        
        //检索附件的回调方法
        loadAttachment(attData);
        //当返回的数据不为空时，说明是根据某个项目或项目区县进行了查询  显示该项目的检查结果
        if(data['flag']){
        	var contentFirst = "";
        	var tr = '<table style="width:98%; text-align:center; margin-top:5px; font-family:verdana; color:black;" border="1"><thead><tr style="height:45px">'+
					        	'<th>序号</th>'+
					            '<th>内容</th>'+
					            '<th>'+testYear+'年完成量,m³</th>'+
					           	'<th>利用率</th>'+
					          	'<th>得分</th>'+
					          	'<th>总得分</th>'+
					          	'<th>完善率</th></tr></thead><tbody>';
				tr += '<tr style="height:30px;"><td>'+1+'</td><td>'+'沥青砼材料回收量'+'</td><td>'+asphalMaterial+'</td><td rowspan="6">'+wholeRate+'%</td><td rowspan="6">'+firstScore+'</td><td rowspan="6" class="sumTd">'+total+'</td><td rowspan="6" class="perTd">'+percent+'%</tr>';
				tr += '<tr style="height:30px;"><td>'+2+'</td><td>'+'沥青砼材料就地利用量'+'</td><td>'+asphalLocalUse+'</td></tr>';
				tr += '<tr style="height:30px;"><td>'+3+'</td><td>'+'沥青砼材料回收再利用量'+'</td><td>'+asphalCycleUse+'</td></tr>';
				tr += '<tr style="height:30px;"><td>'+4+'</td><td>'+'水泥砼材料回收量'+'</td><td>'+cementMaterial+'</td></tr>';
				tr += '<tr style="height:30px;"><td>'+5+'</td><td>'+'水泥砼材料就地利用量'+'</td><td>'+cementLocalUse+'</td></tr>';
				tr += '<tr style="height:30px;"><td>'+6+'</td><td>'+'水泥砼材料回收再利用量'+'</td><td>'+cementCycleUse+'</td></tr>';
        	contentFirst = tr + '</tbody></table>';
			$('#checkResult').append(contentFirst);
        }
        
      //表格二：
       if(data['flagTwo']){
    	var contentSecond = "";
		contentSecond = '<table style="width:98%; height:31px; text-align:center;margin-top:25px;" border="1"><thead><tr style="height:31px">'+
				        	'<th>序号</th>'+
				            '<th>项目名称</th>'+
				            '<th>利用方案（有/无）</th>'+
				            '<th>利用量,m³</th>'+
				            '<th>扣分</th></tr></thead><tbody>';
		for (var i = 0; i< roadCyclesSecond.length; i++){
			contentSecond += '<tr style="height:30px"><td>'+parseInt(i+1)+'</td><td>'+roadCyclesSecond[i].projectName+'</td>';
			
			if (roadCyclesSecond[i].isUseCase == "1"){
				contentSecond += "<td>"+imgRight+"</td>";	
			} else {
				contentSecond += "<td>"+imgError+"</td>";	
			}
			contentSecond += '<td>'+roadCyclesSecond[i].useNumber+'</td><td class="sumTd">'+secondScore[i]+'</td></tr>';
		}
			contentSecond += '</tbody></table>';
			$('#checkResult').append(contentSecond); 
		}
		
    }
</script>
</head>
<body>
    <div id="x_top"></div>
	<tags:message content="${msg}" />
	<c:if test="${not empty checkTable.id}">
		<div style="text-align:center">
			<a href="javascript:void(0);" class="btn btn-primary" onclick="downWord('${ctx}/jsRoadMatRecUtilize/downWord.do?projectId=${fns:encodeParamUrl(projectId)}&menuId=${fns:encodeParamUrl(menuId)}');" id= "btnDown" role="button" ><div id="x_v"></div></a>
		</div>
	</c:if>
    <form id="checkForm" class="form-horizontal"  method="POST"  name="checkForm" action="${ctx}/jsRoadMatRecUtilize/save.do?left=${fns:encodeParam(left)}&top=${fns:encodeParam(top)}&projectId=${fns:encodeParam(projectId)}&menuId=${fns:encodeParam(menuId)}&leftChild=${fns:encodeParam(leftChild)}">
        <input type="hidden" name="token" value="${token}">
        <div id="show">
            <div id="showTable" class="showTable">
                <jsp:include page="/WEB-INF/views/check/common.jsp"/> 
                <div class="model">
					<div>
						<legend>三、检查条件及设置</legend>
						<div class="content-title" id="condition">
							<div style="float: left; margin-right: 10px;">
								<div>
									<span>年份：</span> 
									<select	name="thirdStepScore" id="thirdStepScore">
										<c:forEach items="${fns:getRoadMatRecUtilizeYear(projectId)}"
											var="year" varStatus="idxStatus">
											<option value="${year.testYear}">${year.testYear}</option>
										</c:forEach>
									</select>
									
									<span>工程项目：</span>
									<tags:treeselect id="office" name="itemProjectId" value="" labelName="objectName" labelValue=""
										title="工程项目" url="/jsRoadMatRecUtilize/overloadMechData.do?projectId=${projectId}" allowClear="true" checked ="true"/>
									
								</div>
								<div style="margin-top: 20px">
									<span>循环利用率达标可得总分<font style="color: red;">*</font>：</span> 
										<input type="text" name="yearFull" id="yearFull"  maxlength="6" class="required conInput" value='2'> 
									<span style="margin-left: 15px">可得满分的比率<font style="color: red;">*</font>： </span>
										<input type="text" name=poitMark id="poitMark"  maxlength="6" class="required conInput" value='95'>
								</div>
								<div>
									<span style="margin-left:15px">每比满分比率降低3个千分点扣分<font style="color: red;">*</font>：</span>
										<input type="text" name="firstStepScore" id="firstStepScore"  maxlength="6" class="required conInput" value='0.1'>
									<span style="margin-left:15px">抽查项目无利用方案，每个扣分<font style="color: red;">*</font>：</span>
										<input type="text" name="secondStepScore" id="secondStepScore"  maxlength="6" class="required conInput" value='0.5'>
								</div>
							</div>
							<div id="x_s" style="float: right">
								<div class="x_ico"></div>
								<a href="#javascript:void(0)" onclick="btnClick();" id="btnSearch" role="button">搜索&nbsp;</a>
							</div>
						</div>
					</div>
                <div class="model">
                    <div>
                    	<legend>四、检索结果</legend>
                        <div class="content-title">
                            <div class="tabbox">
                                <div class="tab">
                                 <a href="javascript:;" class="on">规章制度</a>
                                    <c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
                                        <c:if test="${idxStatus.index >= 2}">
                                            <a href="javascript:;">${menu.name}</a>
                                        </c:if>
                                    </c:forEach>
                                </div>
                                 <div class="content">
							    	<ul>
							    		<c:forEach items="${childMenuList}" var="menu"  varStatus="idxStatus">
							    			<c:if test="${idxStatus.index >= 1}">
								    			<li>
								    				<table style="width:98%;text-align:center;margin-top:5px;" border="1" id="${menu.tag}">
								    					<thead>
									    					<th>序号</th>
									    					<th>操作</th>
									    					<th>发文单位</th>
									    					<th>上传用户</th>
									    					<th>文件名</th>
									    					<th>发文日期</th>
									    					<th>上传日期</th>
									    					<th>文件大小</th>
									    					<th>文件类型</th>
								    					</thead>
								    					<tbody>
								    						
								    					</tbody>
								    				</table>
								    			</li>
								    		</c:if>
							    		</c:forEach>
							        </ul>
							    </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="model">
                    <div>
                    	<legend>五、检查评分</legend>
                        <div class="context-title" id="checkResult">
                           
                        </div>
                    </div>
                </div>
                <div class="model">
                    <div class="content-btn">
                        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存" />
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <input id="btnCancel" class="btn" type="button" value="返 回" onclick="toBack()" />
                    </div>
                </div>
            </div>
        </div>
    </form>
    <script src="${ctxStatic}/js/check/checkCommon.js" type="text/javascript"></script>
</body>
</html>